package platformer.view.sprites.states;

public class JumpingRight extends AnimationState{
	
	private enum JumpState {
		frame1, frame2, frame3, frame4, frame5, frame6
	}
	
	private JumpState state;
	
	public JumpingRight() {
		super( 3,7,4 );
		state = JumpState.frame1;
	}
	
	@Override
	public AnimationState getIdle() {
		return new WalkingRight().getIdle();		
	}
	
	@Override
	public int getX()
	{
		
		switch (state) {
			case frame1:
				//state = JumpState.frame2;
				return X;
			case frame2:
				//state = JumpState.frame3;
				return X;
			case frame3:
				//state = JumpState.frame4;
				return X-2;
			case frame4:
				//state = JumpState.frame1;
				return X+2;
			default:
				return X;
		}
	}

	@Override
	public int getY()
	{
		switch (state) {
			case frame1:
				state = JumpState.frame2;
				return Y;
			case frame2:
				state = JumpState.frame3;
				return Y;
			case frame3:
				state = JumpState.frame4;
				return Y+1;
			case frame4:
				state = JumpState.frame1;
				return Y+1;
			default:
				return Y;
		}
	}
}
